<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="javascript" type="text/javascript" src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/jquery.js"></script>
<script src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/frame.js" language="javascript" type="text/javascript"></script>
<link href="http://www.ucmaim.com/Public/Ucmaim/Admin/css/style.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]>
<script src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/DD_belatedPNG.js" language="javascript" type="text/javascript"></script>
<script>
  DD_belatedPNG.fix('.nav ul li a,.top_link ul li,background');   /* string argument can be any CSS selector */
</script>
<![endif]-->
</head>
<body class="showmenu">
<style type="text/css">
    .layui-layer-tips{width:auto !important;}
</style>
<script src="http://www.ucmaim.com/Public/Ucmaim/Home/Js/common.js" type="text/javascript"></script>
<script src="/Public/Layer/layer.js" type="text/javascript"></script>
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31"><div class="titlebt">会员列表</div></td>
    </tr>
</table>

<div class="main">
    <div class="operate">
        <div class="left">
            <input type="button" onclick="window.open('<?php echo U('Admin/Member/Add');?>','main')" target="main" class="btn_blue" value="添加">
        </div>
        <div class="left_pad">
            <form method="get" action="<?php echo U('Admin/Member/Search', 'do=Search');?>">
                <input type="text" name="keyword" title="关键字" class="inp_default" value="<?php echo ($keyword); ?>" placeholder="请输入用户名/手机号/邮箱">
                <input type="submit" class="btn_blue" value="查  询">
            </form>
        </div>
    </div>
    <div class="list">
        <form action="<?php echo U('Game/GameList', 'do=sort');?>" method="post" id="form_do" name="form_do">


            <table width="100%">
                <tr>
                    <!--<th><input  name="chkall" type="checkbox" id="chkall" onClick="selectall(this.form)"></th>-->
                    <th>编号</th>
                    <th style="text-align:left;">用户名</th>
                    <th>电话</th>
                    <th>邮箱</th>
                    <th>QQ</th>
                    <th>注册时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>

                <?php if(empty($list)): ?><tr>
                        <td colspan="9">本区域暂无数据显示...</td>
                    </tr>
                    <?php else: ?>
                    <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr>
                            <td><?php echo ($v["member_id"]); ?></td>
                            <td class="aleft">
                                <a href="javascript:;" uid="<?php echo ($v["user_id"]); ?>" class="username" target="_self"><?php echo (replacement($v["member_name"])); ?></a>
                            </td>
                            <td><?php echo ($v["member_mobile"]); ?></td>
                            <td><?php echo ($v["member_email"]); ?></td>
                            <td><?php echo ($v["member_qq"]); ?></td>
                            <td><?php echo (date('Y-m-d H:i:s', $v["member_time"])); ?></td>
                            <td><?php if($v['member_status'] == 1): ?><span class="green">已激活</span><?php else: ?><span class="red">已禁用</span><?php endif; ?></td>
                            <td>
                                <a href="<?php echo U('Admin/Member/Edit','uid='.$v['member_id']);?>">编辑</a>
                                <?php if($v['member_status'] == 0): ?><a href="<?php echo U('Admin/Member/Unlock','uid='.$v['member_id']);?>" class="delete-one">激活</a>
                                    <?php else: ?>
                                    <a href="<?php echo U('Admin/Member/Lock','uid='.$v['member_id']);?>" class="active-one">禁用</a><?php endif; ?>
                            </td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>


            </table>
        </form>

    </div>

    <div class="page">
        <?php echo ($page); ?>
    </div>

</div>

<script type="text/javascript">
    $('.delete-one').click(function(){
        if( ! window.confirm('确定要禁用此用户吗？') ){
            return false;
        }
    });

    $('.username').click(function(){
        var _this = $(this);
        $.post("<?php echo U('/Api/UserInfo');?>", {
            uid: _this.attr('uid')
        }, function(data){
            layer.tips(data, _this, {
                width: '100%',
                time: 0
            });
            $(document).click(function(){
                layer.closeAll()
            });
        });
    });


</script>
</body>
</html>